Conversation
Adds subscribed/followed artists to the Library view, closing GitHub issue #60. - Add `getLibraryArtists()` to `YTMusicClientProtocol` and `YTMusicClient` - Fetches from `FEmusic_library_corpus_track_artists` (the filter chip endpoint from `FEmusic_library_landing`, no extra params required) - Extend `PlaylistParser.LibraryContent` with `artists: [Artist]` field - `parseLibraryContent` now classifies `UC*` browse IDs as artists - Add `parseLibraryArtists(_:)` for the dedicated artists endpoint - Update `LibraryViewModel` to fetch artists in parallel with library content - Add `artists: [Artist]`, `libraryArtistIds: Set<String>` - Add `addToLibrary(artist:)`, `removeFromLibrary(artistId:)`, `isInLibrary(artistId:)` - Update `LibraryView` with: - New `artists` case in `LibraryFilter` enum (between Playlists and Podcasts) - `artistCard()` view (circular thumbnail, artist name, Artist subtitle) - `navigationDestination(for: Artist.self)` to ArtistDetailView - Updated empty-state messages for the artists filter - Update `MockYTMusicClient` and `MockUITestYTMusicClient` with `getLibraryArtists()` - Add comprehensive artist library tests to `LibraryViewModelTests` Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR adds support for displaying subscribed/followed artists in the Library view, addressing issue #60. The implementation adds a new "Artists" filter to the Library view and fetches artist data from YouTube Music's dedicated library artists endpoint.
Changes:
- Added "Artists" filter option to Library view with circular thumbnails and dedicated empty states
- Implemented artist fetching via new
getLibraryArtists()API method usingFEmusic_library_corpus_track_artistsendpoint - Added comprehensive test coverage for artist library operations (add, remove, check, refresh)
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| Views/macOS/LibraryView.swift | Added Artists filter, navigation destination, artist card UI, and updated LibraryItem enum to include artists |
| Core/ViewModels/LibraryViewModel.swift | Added artist state management properties and methods (addToLibrary, removeFromLibrary, isInLibrary) with concurrent fetching |
| Core/Services/API/YTMusicClient.swift | Implemented getLibraryArtists() method to fetch from FEmusic_library_corpus_track_artists endpoint |
| Core/Services/API/Parsers/PlaylistParser.swift | Added parseLibraryArtists() parser and updated LibraryContent struct (though artists from getLibraryContent are unused) |
| Core/Services/Protocols.swift | Added getLibraryArtists() method to YTMusicClientProtocol |
| Tests/KasetTests/LibraryViewModelTests.swift | Added 9 comprehensive tests for artist library functionality |
| Tests/KasetTests/Helpers/MockYTMusicClient.swift | Implemented mock support for getLibraryArtists() |
| Core/Services/API/MockUITestYTMusicClient.swift | Implemented mock support for getLibraryArtists() for UI tests |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| struct LibraryContent { | ||
| let playlists: [Playlist] | ||
| let podcastShows: [PodcastShow] | ||
| let artists: [Artist] |
There was a problem hiding this comment.
The artist parsing logic added to parseLibraryContent and its helper functions is never used since the LibraryViewModel only uses artists from getLibraryArtists() (line 137 in LibraryViewModel.swift sets self.artists = fetchedArtists, ignoring content.artists). Consider either using content.artists or removing the artist parsing logic from parseLibraryContent(), parseLibraryItem(), and parseLibraryItemFromResponsive() to avoid unnecessary computation and maintain clarity about which data sources are actually used.
Adds Artists section to the Library, allowing users to browse their subscribed/followed artists from YouTube Music.
Closes #60